package com.demo.util;


import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * @项目名称：dream-face
 * @类名称：DateUtils @类描述：
 * @创建人：YangChao
 * @联系方式：18629233301@163.com
 * @创建时间：2017年3月6日 上午11:57:42
 * @version 1.0.0
 */
public class DateUtils {
	public static final String YYYYMMDDHHMMSSS = "yyyy-MM-dd HH:mm:ss.sss";
	public static final String YYYYMMDDHHMMSS = "yyyy-MM-dd HH:mm:ss";
	public static final String YYYY_MM_DD = "yyyy-MM-dd";
	public static final String YYYYMMDD = "yyyyMMdd";
	public static final String YYMMDD = "yyMMdd";
	public static final String YYMD = "yy-m-d";

	public static String getCurrentDate(String pattern) {
		Calendar current = Calendar.getInstance();
		SimpleDateFormat smdf = new SimpleDateFormat(pattern);
		String nowDate = new String(smdf.format(current.getTime()));
		return nowDate;
	}

}
